package cn.com.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import cn.com.database.helper.MySQLDBHelper;

public class Test {

	@Autowired
	private static MySQLDBHelper mySQLDBHelper;
	
	public static String fetchAllRelativeSalesman(String id){
		Map salesman = mySQLDBHelper.retriveByID("salesman", "ID", id);
		String upsalesmanid = salesman.get("UpSalesmanID").toString();
		String result = salesman.get("ID") + ",";
		while(!upsalesmanid.equals("0"))
		{
			Map temp = mySQLDBHelper.retriveByID("salesman", "ID", upsalesmanid);
			upsalesmanid = temp.get("UpSalesmanID").toString();
			result += temp.get("ID") + ",";
		}
		return result;
	}
	
	public static void main(String[] args) {
		/*System.out.println(fetchAllRelativeSalesman("14"));*/
		int i = 10;
		for(int j = 0 ; j < 10 ;j++){
			switch(i){
			case 8:
				System.out.println("------8----------");
				continue;
			case 9:
				System.out.println("------9----------");
				continue;
			case 10:
				System.out.println("------10----------");
				continue;
			case 11:
				System.out.println("------11----------");
				continue;
			default:
				System.out.println("------0----------");
			}
			System.out.println("end");
		}
		System.out.println("finish");
	}

}
